#ifndef __CANQUEUE_H
#define __CANQUEUE_H

#include "stm32f4xx.h"

#ifdef __cplusplus
extern "C" {
#endif

#define CANQUEUE_BUFSIZE 4

typedef struct{
    uint8_t size;
    uint8_t is_empty;
    CanRxMsg buf[CANQUEUE_BUFSIZE];
    uint8_t head;
    uint8_t tail;
    CanRxMsg* front_ptr;
    void (*push)(CanRxMsg* m);
    CanRxMsg (*pop)(void);
}CanQueue_T;

extern CanQueue_T CAN1_queue;

void canqueue_init(void);

#ifdef __cplusplus
}
#endif /* __cplusplus */

#endif
